{
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
}
var
	a,b,c,d:integer;
	t:char;
begin
	a:=0;
	b:=0;
	c:=0;
	d:=0;
	while not eoln do
	begin
		read(t);
		if (ord('A') <= ord(t)) and (ord(t) <= ord('Z')) then inc(a);
		if (ord('a') <= ord(t)) and (ord(t) <= ord('z')) then inc(b);
		if (ord('0') <= ord(t)) and (ord(t) <= ord('9')) then inc(c);
		if (t=' ') then inc(d);
	end;
	writeln(a,' ',b,' ',c,' ',d);
end.
